<?php
namespace api\common\model;
use think\Db;
class Config extends \think\Model // 配置
{   
    
    protected $table = 'config';
    
    /**
     * 根据字段查询信息
     */
    public function selByField($field){
        $res = Db::query('select * from mj_config where  field = "'.$field.'" and overTime>now()');
        return $res[0];
    }

    /**
     * 根据字段修改信息
     */
    public function updByField($field,$data){
        $res = Db::name($this->table)->where('field',$field)->update($data);
        return $res;
    }
}
